import { createApp } from "vue";
// pinia 持久化插件 https://prazdevs.github.io/pinia-plugin-persistedstate/zh/guide/config.html
import { createPinia } from "pinia";
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
// element-plus
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import "element-plus/dist/index.css";
// 路由、守卫
import router from "./router";
import "./router/routerProtect";
// 挂载页
import App from "./App.vue";

const app = createApp(App);
app
  .use(createPinia().use(piniaPluginPersistedstate))
  .use(router);

// 注册elementplus图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

// import { getUserInfo, getProjectVersion } from './api/init';
(async function () {
  app.mount("#app");
})();
